// +----------------------------------------------------------------------
// | CRMEB [ CRMEB赋能开发者，助力企业发展 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2016~2024 https://www.crmeb.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed CRMEB并不是自由软件，未经许可不能去掉CRMEB相关版权
// +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com>
// +----------------------------------------------------------------------

import request from "../utils/request.js";

/**
 * 积分商城首页
 */
export function getStoreIntegral(data) {
	return request.get("store_integral/index", data, {
		noAuth: true
	});
}

/**
 * 积分商品分类列表
 */
export function getStoreIntegralCategory() {
	return request.get("store_integral/category", {}, {
		noAuth: true
	});
}

/**
 * 积分商品列表
 */
export function getStoreIntegralList(data) {
	return request.get("store_integral/list", data, {
		noAuth: true
	});
}

/**
 * 积分商品详情
 */
export function getStoreIntegralDetail(id) {
	return request.get(`store_integral/detail/${id}`, {}, {
		noAuth: true
	});
}

/**
 * 积分订单确认
 */
export function confirmIntegralOrder(data) {
	return request.post("store_integral/order/confirm", data);
}

/**
 * 创建积分订单
 */
export function createIntegralOrder(data) {
	return request.post("store_integral/order/create", data);
}

/**
 * 积分订单详情
 */
export function getIntegralOrderDetail(orderId) {
	return request.get(`store_integral/order/detail/${orderId}`);
}

/**
 * 积分订单列表
 */
export function getIntegralOrderList(data) {
	return request.get("store_integral/order/list", data);
}

/**
 * 确认收货
 */
export function takeIntegralOrder(data) {
	return request.post("store_integral/order/take", data);
}

/**
 * 查看物流
 */
export function getIntegralOrderExpress(orderId) {
	return request.get(`store_integral/order/express/${orderId}`);
}

/**
 * 删除积分订单
 */
export function deleteIntegralOrder(data) {
	return request.post("store_integral/order/del", data);
}
